package cn.tedu.bonfire.admin.content.schedule;

import cn.tedu.bonfire.admin.content.service.IArticleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ArticleSchedule {
    @Autowired
    private IArticleService articleService;

    @Scheduled(cron = "0 30 2 * * ?") // 每日凌晨2:30执行
    public void rebuildSearch() {
        log.debug("开始执行【重建文章的搜索数据】计划任务");
        articleService.rebuildSearch();
    }
}
